Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

391
Vistas
[Vue warn]: Error in v-on handler: "TypeError: Object(...)(...).httpsCallable(...).then is not a function"

I'm trying to call this firebase cloud functions from my Vue app

exports.sayHi = functions.https.onCall((data, context) =>{
  return "hi";
});

This is my action in the store

import {
  getFirebaseDB,
  getFirebaseFunctions,
} from "../../helpers/firebase/authUtils";

reserveApt() {
    getFirebaseFunctions()
      .httpsCallable("sayHi")
      .then((result) => {
        console.log(result);
      });
  },

and this is my helper functions in ../../helpers/firebase/authUtils:

import firebase from "firebase/app";
import "firebase/auth";
import "firebase/firestore";
import "firebase/functions";

/**
 * Initilize the backend
 * @param {*} config
 */
const initFirebaseBackend = (config) => {
  if (!_fireBaseBackend) {
    _fireBaseBackend = new FirebaseAuthBackend(config);
    _db = firebase.firestore();
    _functions = firebase.functions();
  }
  return _fireBaseBackend;
};


/**
 * Returns the firebase backend
 */
const getFirebaseBackend = () => {
  return _fireBaseBackend;
};


/**
 * returns firestore db
 */
const getFirebaseDB = () => {
  if (!_db) {
    _db = firebase.firestore();
  }
  return _db;
};


/**
 * returns firebase functions
 */
const getFirebaseFunctions = () => {
  if (!_functions) {
    _functions = firebase.functions();
  }
  return _functions;
};


export {
  initFirebaseBackend,
  getFirebaseBackend,
  getFirebaseDB,
  getFirebaseFunctions,
};

Firebase is properly initialized and all the other functions like auth and firestore work perfectly but when I call this I get this error:

[Vue warn]: Error in v-on handler: "TypeError: Object(...)(...).httpsCallable(...).then is not a function"

found in

---> <Properties> at src/views/pages/property/properties.vue
       <App> at src/App.vue
         <Root>
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

So apparently the problem was in calling the function. I had to call it like this:

var reserve = getFirebaseFunctions().httpsCallable("sayHi");
    reserve().then((result) => {
      console.log(result);
    });

but I'm not sure why!!

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda